/*
 * logout.java
 *
 * Created on March 26, 2007, 7:11 AM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package edu.byu.isys413.actions;

import java.util.Random;
import javax.servlet.http.*;
import edu.byu.isys413.group1E.data.*;
import edu.byu.isys413.group1E.handlers.*;

/**This action takes the user back to the login screen, and clears the Session's transaction & customer objects
 *
 * @author Kendall Frazier
 */
public class logout implements edu.byu.isys413.web.Action {
    
    /**
     * Creates a new instance of logout
     */
    public logout() {
    }
  
    /** 
     *Processes this method is called when the user clicks "logout" from the isstart.jsp.  The Transaction and customer
     *information are removed from the session and index.jsp is called (the login screen).
     *
     *@param HttpServletRequest
     *@param HttpServletResponse
     *
     *@return String the name of the jsp to call
     */
    public String process(HttpServletRequest request, HttpServletResponse response) throws Exception {
        HttpSession session = request.getSession();
        
        session.removeAttribute("TX");
        session.removeAttribute("customer");
        
        return "index.jsp";
    }//process
    
    
}//logout class
